package com.project.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.project.entity.ProcureApplyEntity;
import com.project.entity.UserOrderEntity;
import com.project.entity.UserOrderInfoProductEntity;
import com.project.service.IProcureApplyService;
import com.project.service.IUserOrderService;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.concurrent.TimeUnit;

@RestController
@RequestMapping("procureApply")
public class ProcureApplyController {

    @Autowired
    private IProcureApplyService procureApplyService;


    /**
     *查找采购申请
     */
    @RequestMapping("findByItem")
    public IPage<ProcureApplyEntity> findByItem(int pageNO,  int pageSize, int status) {
        return procureApplyService.findByItem(pageNO,pageSize,status);
    }
    /**
     采购对象和包含的商品对象
     */
    @RequestMapping("findById")
    public ProcureApplyEntity findById(String applyRef) {
        return procureApplyService.findById(applyRef);
    }
    /**
     采购对象和包含的商品对象
     */
    @RequestMapping("updateStatus")
    public String updateStatus(String applyRef, int status, String cause, HttpServletRequest request){

        procureApplyService.updateStatus(applyRef, status, cause, "request"); //获取审核人
        return "ok";

    }


}
